package cn.cecurio.multithread.ch1_2_3;

/**
 * @author: Cecurio
 * @create: 2018-01-16 19:28
 **/
public class LoginServlet {
    private static String usernameRef;
    private static String passwordRef;

    synchronized public static void doPost(String username, String password) {
        try {
            usernameRef = username;
            if ("a".equals(username)) {
                Thread.sleep(5000);
            }
            passwordRef = password;
            System.out.println("username=" + usernameRef + ",password=" + passwordRef);

        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

}
